${config_iframe}
<title>${config_id}</title>
<link href="plug-in/chrhc/style.css" rel="stylesheet">
<style type="text/css"> 
.datagrid .datagrid-pager {
  margin-top: -44px;
}
 </style>

<#-- <#include "encode_url.ftl"> -->
<script type="text/javascript" src="plug-in/tools/json2.js"></script>

<script type="text/javascript">
 
//alert(parent.url_title_map[ location.href + "#"]);
/**
*表单的高度,表单的宽度
**/
var ${config_id}Fw =<#if head.cardWidth?? && head.cardWidth!=''> ${head.cardWidth}  <#else>700</#if>,
	${config_id}Fh =<#if head.cardHeight?? && head.cardHeight!=''> ${head.cardHeight} <#else>400</#if>;
	var tablename = '${config_id}';
	var initquery = '${initquery}';
var Common = {

    //EasyUI用DataGrid用日期格式化
    DateFormatter: function (value, rec, index) {
        if (value == undefined||value.length<10) {
            return "";
        }
        return value.substr(0,10);
    }
};

$(function(){
	$.get("cgFormHeadController.do?checkIsExit&checkIsTableCreate&name=${config_id}",
	function(data){
		data = $.parseJSON(data);
		if(data.success){
			createDataGrid${config_id}();
		}else{
			alertTip('表:<span style="color:red;">${config_id}</span>还没有生成,请到表单配置生成表');
		}
	});
});
function createDataGrid${config_id}(){
	var _columns = [
		[	
			<#if config_istree=="Y">
				<#list config_fieldList  as x>  
					<#if x_index==0>{field:"id", title:"${x['field_title']}", hidden:true}, </#if>
					<#if x_index!=0>{field:"${x['field_id']}", title:"${x['field_title']}",<#if x['field_isShow'] == "N" >hidden:true,</#if><#if x['field_href'] != "">formatter:function(value,rec,index){var href='';href+="<a href='#' onclick=\"addOneTab('字段链接','${x['field_href']}')\" ><u>"+value+"</u></a>";return href;},</#if> width:100}, </#if>
				</#list>
			<#else>
					<#if config_ischeckbox=="Y">{field:'ck',checkbox:true},</#if>
					{field:'_number',title:"序号",align:"center",formatter:function(value,rec,index){
						var xh = index + 1;
						var xhhref = "<span onclick='javascript:${config_id}update(\"" + rec.id + "\");' style='cursor:pointer' >" + xh + "</span>";
					
						 	<#if config_noliststr?index_of("update")==-1>
						 		return xhhref;
						 	<#else>
						 	return xh;
						 	</#if>
						
						 
				 	}},
					<#assign isWriteHref="false"/>
 
					<#list config_fieldList  as x>  
						 {	field:'${x['field_id']}',
						 	title:'${x['field_title']}',
						 	<#if x['field_isShow'] == "N" || x['field_showType']=="file" >hidden:true,
						 	</#if>
						 	<#if x['field_href'] != "">
						 	formatter:function(value,rec,index){
						 		var href='';
						 		href+=applyHref('字段链接','${x['field_href']}',value,rec,index);
						 		return href;
						 	},
						 	</#if>
						 	
						 	<#if isWriteHref == "false"  &&  x['field_isShow'] == "Y">
						 		<#assign isWriteHref="true"/>
						 		<#if config_noliststr?index_of("update")==-1>
								 	formatter:function(value,rec,index){
								 		return "<a href='javascript:${config_id}update(\"" + rec.id + "\");'><u>" + value + "</u></a>";
								 	},
							 	</#if>
						 	</#if>
						 							 	
						 	<#if x['field_showType']=="file">
						 	formatter:function(value,rec,index){
						 		var href='';
						 		if(value==null || value.length==0){
						 			return href;
						 		}
						 		if(value.indexOf(".jpg")>-1 || value.indexOf(".gif")>-1 || value.indexOf(".png")>-1){
						 			href+="<img src='"+value+"'/>";
						 		}else{
						 			href+="<a href='"+value+"' target=_blank><u>点击下载</u></a>";
						 		}
						 		return href;
						 	},
						 	</#if>
						 	
						 	<#if x['field_showType']=="date">
						 	formatter:Common.DateFormatter,
						 	</#if>
						 	
						 
						 	sortable:true,
						 	width:${x['field_length']}
						 	},
					</#list>
			</#if>

			{field:'opt',title:'操作',align: 'center',formatter:function(value,rec,index){
						if(!rec.id){return '';}
						var href='';
				 
						if(rec.bpm_status!=null&&rec.bpm_status.indexOf('提交')>0){
							href+="[<a href='#' onclick=confirm('activitiController.do?startOnlineProcess&configId=${config_id}&id="+rec.id+"','确认提交流程','${config_id}List')>";
							href+="提交流程</a>]";
						}
						
						<#list config_buttons as x>
							<#if x['buttonStyle'] == 'link' && x['buttonStatus']=='1' && config_noliststr?index_of("${x['buttonCode']}")==-1>
							
							if( '${x['exp']!""}' ){
								var exp = '${x['exp']!""}' ;
					    		var attrs = exp.split("#");
					    	 	//alert(rec['auto_flag']);
								if(eval("'" + rec[attrs[0]] + "'" + attrs[1]) == true || eval("'" + rec[attrs[0]] + "'" + attrs[1]) == 'true'){
									href+="[<a href='#' buttonCode='${x['buttonCode']}' formId ='${x['formId']}' ";
									<#if x['optType'] == 'action'>
									href+=" onclick=\"doBusButtonForLink('cgFormBuildController.do?doButton&formId=${x['formId']}&buttonCode=${x['buttonCode']}&tableName=${config_id}','${x['buttonName']}','${config_id}List','"+rec.id+"')\"";
									<#else>
									href+=" onclick=\"${x['buttonCode']}('"+rec.id+"');\"";
									</#if>
									href+=" id=\"${x['buttonCode']}\">";
									href+="${x['buttonName']}</a>]";									
								}
													    	 							
							}else {
								href+="[<a href='#' buttonCode='${x['buttonCode']}' formId ='${x['formId']}' ";
								<#if x['optType'] == 'action'>
								href+=" onclick=\"doBusButtonForLink('cgFormBuildController.do?doButton&formId=${x['formId']}&buttonCode=${x['buttonCode']}&tableName=${config_id}','${x['buttonName']}','${config_id}List','"+rec.id+"')\"";
								<#else>
								href+=" onclick=\"${x['buttonCode']}('"+rec.id+"');\"";
								</#if>
								href+=" id=\"${x['buttonCode']}\">";
								href+="${x['buttonName']}</a>]";
							}
							</#if>
						</#list>
						return href;
						}
			}
		]
	];
 
	<#if (config_link_buttons?size == 0) >
		
	  var delOptFlag = true;		
	  for( var i in _columns[0]){
	  	 if(_columns[0][i].field == "bpm_status"){
	  	 	delOptFlag = false;
	  	 	break;
	  	 }
	  }
	  if(delOptFlag){
	  	_columns[0].pop();
	  }
	</#if>  
		
	var initUrl = 'chrhcAutoListController.do?<#if dataMethod?? && dataMethod!=''>${dataMethod}<#else>datagrid</#if>&configId=${config_id}&field=${fileds}${initquery}&biztype=${bizType!}';
	initUrl = encodeURI(initUrl);
	//alert(initUrl);
	$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>(
	{
	<#if config_istree=="Y">treeField:'text',</#if>
	url:initUrl,
	idField: 'id',
	/*title: '<#if bizTypeText?? && bizTypeText != ''>${bizTypeText}</#if>${config_name}',*/
	fit:true,
	fitColumns:true,
	pageSize: 10,
	<#if config_ispagination =="Y">pagination:true,</#if>
	<#if config_ischeckbox=="Y">singleSelect:false,<#else>singleSelect:true,</#if>
	<#if fileds?index_of("create_datetime")!=-1 >
		sortName:'create_datetime',
	<#elseif fileds?index_of("sfhz")!=-1 && fileds?index_of("create_date")!=-1>
		sortName:'sfhz desc, create_date',
	<#elseif fileds?index_of("create_date")!=-1 && fileds?index_of("create_datetime")==-1>
		sortName:'create_date',
	<#else>
		sortName:'id',
	</#if>
	pageList:[10,30,50,100],
	sortOrder:'desc',
	rownumbers:false,
	showFooter:true,
	frozenColumns:[[]],
	rowStyler: function(index,row){
		if (index%2==1){
			return 'background-color:#eeeeee;';
		}
	},
	columns: _columns,
	onLoadSuccess:function(data){
		$("#${config_id}List").<#if config_istree=="Y">treegrid<#else>datagrid</#if>("clearSelections");
		window.top.closeLoadingDialog();
		$("#${config_id}List datagrid-pager pagination").css("margin-top","-44px");
	},
	onLoadError:function(data){
		if(data && data.responseText){
			//超时判断，跳转登录
			if(data.responseText.indexOf('loginController.do?login') != -1){
			    //判断如果当前页面不为主框架，则将主框架进行跳转
			  	var tagert_URL = "${basePath}/loginController.do?login";
			    if(self==top){
			    	window.location.href = tagert_URL;
			    }else{
			    	top.location.href = tagert_URL;
			    }
			}
		}
	},
	onClickRow:function(rowIndex,rowData)
		{rowid=rowData.id;gridname='${config_id}List';},
	onBeforeLoad:function(param)
		{ 
		 window.top.showLoadingDialog();
		},
		loadMsg:'',
	onDblClickRow:function(rowIndex,rowData)
		{${config_id}view(rowData.id);}
	});
	$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('getPager').pagination({beforePageText:'',afterPageText:'/{pages}',displayMsg:'{from}-{to}共{total}条',showPageList:true,showRefresh:true});
	$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('getPager').pagination({onBeforeRefresh:function(pageNumber, pageSize){ $(this).pagination('loading');$(this).pagination('loaded'); }});
	//将没有权限的按钮屏蔽掉
	<#list config_nolist as x>
	 
		$("#${config_id}Listtb").find("#${x.operationcode}").hide();
	</#list>
	}
	//列表刷新
	function reloadTable(){	
		try{
			$('#${config_id}List').datagrid('reload');
			$('#${config_id}List').treegrid('reload');
		}catch(ex){
			//donothing
		}
	}
	
	function fitColumns(){	
		try{
				$('#${config_id}List').datagrid('fitColumns');
		}catch(ex){
			//donothing
		}
	}	

	
	//列表刷新-推荐使用
	function reload${config_id}List(){
		//$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('reload');
		${config_id}Listsearch();
	}
	/**
	 * 获取列表中选中行的数据-推荐使用
	 * @param field 数据中字段名
	 * @return 选中行的给定字段值
	 */
	function get${config_id}ListSelected(field){
		var row = $('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('getSelected');
		if(row!=null){value= row[field];
		}else{
			value='';
		}
		return value;
	}
	/**
	 * 获取列表中选中行的数据
	 * @param field 数据中字段名
	 * @return 选中行的给定字段值
	 */
	function getSelected(field){
		var row = $('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('getSelected');
		if(row!=null){value= row[field];
		}else{
			value='';
		}
		return value;
	}
	/**
	 * 获取列表中选中行的数据（多行）
	 * @param field 数据中字段名-不传此参数则获取全部数据
	 * @return 选中行的给定字段值，以逗号分隔
	 */
	function get${config_id}ListSelections(field){
		var ids = '';
		var rows = $('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('getSelections');
		for(var i=0;i<rows.length;i++){
			ids+=rows[i][field];
			ids+=',';
		}
		ids = ids.substring(0,ids.length-1);
		return ids;
	}
	/**
	 * 列表查询
	 */
	function ${config_id}Listsearch(){
		var queryParams=$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('options').queryParams;
		$('#${config_id}Listtb').find('*').each(
			function(){
			queryParams[$(this).attr('name')]=$(this).val();});
			$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>({url:'chrhcAutoListController.do?datagrid&configId=${config_id}&field=${fileds}${initquery}&biztype=${bizType!}',pageNumber:1});
	}
	function dosearch(params){
		var jsonparams=$.parseJSON(params);
		$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>({url:'chrhcAutoListController.do?datagrid&configId=${config_id}&field=${fileds}&biztype=${bizType!},',queryParams:jsonparams});
	}
	function ${config_id}Listsearchbox(value,name){
		var queryParams=$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('options').queryParams;
		queryParams[name]=value;
		queryParams.searchfield=name;
		$('#${config_id}List').<#if config_istree=="Y">treegrid<#else>datagrid</#if>('reload');
	}
	$('#${config_id}Listsearchbox').searchbox({
		searcher:function(value,name){
			${config_id}Listsearchbox(value,name);
		},
		menu:'#${config_id}Listmm',
		prompt:'请输入查询关键字'
	});
	//查询重置
	function ${config_id}searchReset(name){ 
		$("#"+name+"tb").find("input[type!='hidden']").val("");
		$("#"+name+"tb").find("select").val("");
		${config_id}Listsearch();
	}
	//将字段href中的变量替换掉
	function applyHref(tabname,href,value,rec,index){
		//addOneTab(tabname,href);
		var hrefnew = href;
		var re = "";
		var p1 = /\#\{(\w+)\}/g;
		try{
			var vars =hrefnew.match(p1); 
			for(var i=0;i<vars.length;i++){
				var keyt = vars[i];
				var p2 = /\#\{(\w+)\}/g;
				var key = p2.exec(keyt);
				 hrefnew =  hrefnew.replace(keyt,rec[key[1]]);
			}
		}catch(ex){
		}
		re += "<a href = '#' onclick=\"addOneTab('"+tabname+"','"+ hrefnew+"')\" ><u>"+value+"</u></a>";
		return re;
	}
	//SQL增强入口-按钮
	function doBusButton(url,content,gridname){
		var rowData = $('#'+gridname).datagrid('getSelected');
		if (!rowData) {
			tipAlert('请选择一条信息');
			return;
		}	
		url = url + '&id='+rowData.id;
		createdialog('确认 ', '确定'+content+'吗 ?', url,gridname);
	}
	//SQL增强入口-操作列里的链接
	function doBusButtonForLink(url,content,gridname,rowData){
		if (!rowData) {
			tipAlert('请选择一条信息');
			return;
		}	
		url = url + '&id='+rowData;
		createdialog('确认 ', '确定'+content+'吗 ?', url,gridname);
	}
	//新增
	function ${config_id}add(){
		//parent.addTab
		$(".datagrid").hide();
		var url = 'chrhcFormBuildController.do?ftlForm&tableName=${config_id}&bizType=${bizType!}${initquery}';		
		$("#editFormDiv").show();
		$("#editForm").attr("src",url); 
	}
	//修改
	
	function ${config_id}update(id){
		openLoadingDialog();
		$(".datagrid").hide();
		var url = 'chrhcFormBuildController.do?ftlForm&tableName=${config_id}&bizType=${bizType!}${initquery}';
		if(!id){
			id = getSelected("id");
		}
		url += '&id='+ id;
		$("#editFormDiv").show();
		$("#editForm").attr("src",url); 
	}
	//查看
	function ${config_id}view(id){
		$(".datagrid").hide();
		var url = 'chrhcFormBuildController.do?ftlForm&tableName=${config_id}&mode=read&bizType=${bizType!}';
		if(!id){
			id = getSelected("id");
		}
		url += '&id='+ id;
		$("#editFormDiv").show();
		$("#editForm").attr("src",url); 
	}
	
	//批量删除
	function ${config_id}delBatch(){
		//获取选中的ID串
		var ids = get${config_id}ListSelections('id');
		if(ids.length<=0){
			tipAlert('请选择至少一条信息');
			return;
		}
		
		//确认框形式的删除弹窗
		top.art.dialog({
			id:"cancelDialogId",
		    title: '操作提示',
		    icon:'delete',
		    lock:true,
		    content: '确定删除吗? ',
		    ok: function () {
				$.ajax({
				    url:"chrhcAutoListController.do?delBatch",
				    data:{'ids':ids,'configId':'${config_id}'},
					type:"Post",
				    dataType:"json",
				    success:function(data){
						tip(data.msg);
						reload${config_id}List();
				    },
					error:function(data){
						$.messager.alert('错误',data.msg);
					}
				});
		    },
		    cancel: true
		});
		 
	}

 
	var exportWin ;
	function ${config_id}ExportExcel(){
		
		if(exportWin && !exportWin.closed ){
			return ;
		}
		var queryParams = $('#${config_id}List').datagrid('options').queryParams;
		$('#${config_id}Listtb').find('*').each(function() {
		    queryParams[$(this).attr('name')] = $(this).val();
		});
		var params = '&';
		$.each(queryParams, function(key, val){
			params+='&'+key+'='+val;
		}); 
		var fields = '&field=';
		$.each($('#${config_id}List').datagrid('options').columns[0], function(i, val){
			if(val.field != 'opt'){
				if(val.field!='ck'&&val.field!='_number')
				{
					fields+=val.field+',';
				}
			}
		}); 
		//window.location.href = "excelTempletController.do?exportXls&tableName=${config_id}&bizType=${bizType!}${initquery}"+encodeURI(params+fields) ;
		exportWin = window.open( "excelTempletController.do?exportXls&tableName=${config_id}&bizType=${bizType!}${initquery}"+encodeURI(params+fields));
	}
	
	
	var prve_next_url ;
	function nextRecord(id,stepNum){
		var queryParams = $('#${config_id}List').datagrid('options').queryParams;
		$('#${config_id}Listtb').find('*').each(function() {
		    queryParams[$(this).attr('name')] = $(this).val();
		});
		
		var params = '&id=' + id + '&stepNum=' + stepNum;
		
		var sortName = $('#${config_id}List').datagrid('options').sortName;  
		params += ('&sort=' + sortName);
		
		var sortOrder = $('#${config_id}List').datagrid('options').sortOrder;  
		params += ('&order=' + sortOrder);
		
		$.each(queryParams, function(key, val){
			params+='&'+key+'='+val;
		}); 
		var fields = '&field=';
		$.each($('#${config_id}List').datagrid('options').columns[0], function(i, val){
			if(val.field != 'opt'){
				if(val.field!='ck')
				{
					fields+=val.field+',';
				}
			}
		}); 
		
		var url = "chrhcAutoListController.do?nextRecord&configId=${config_id}&biztype=${bizType!}" ;
		
		$.ajax({
			type: 'POST',
			url: url ,
			data: params+fields ,
			dataType:'json', 
			async : false ,
			success: function(d) {  
				var id = d.msg;	 
				if(id){
					prve_next_url = "chrhcFormBuildController.do?ftlForm&tableName=${config_id}";
					if($("#editForm").attr("src").indexOf("mode=read")!=-1){
						prve_next_url += "&mode=read";
					}
					prve_next_url += "&biztype=${bizType!}${initquery}&id="+ id
					//$("#editForm").attr("src",url); 
				}else {
					prve_next_url = '';
				}			
			}
		});		
	 	return prve_next_url ;
		
	}
</script>

${config_jsenhance}

<div class="tab-content tab-box datagrid">
  	<div class="Current_position" style="display: none">
    	<img src="plug-in/media/image/dingwei.png"/><span style="font-size:14px; color:#666666;">当前所在的位置：</span>
		<script type="text/javascript">
			if(parent.url_title_map[ location.href + "#"]){
				document.write(parent.url_title_map[ location.href + "#"]);
			}
		</script>
    </div>
</div>


<table width="100%"   id="${config_id}List" toolbar="#${config_id}Listtb"></table>
<div id="${config_id}Listtb" style="padding:3px; height: auto">
<div name="searchColums">
<#if config_querymode == "group">
	<#list config_queryList  as x>
		<#if (x['field_mainQuery']!)=="Y" >
			<#if x['field_isQuery']=="Y" >
			<span style="display:-moz-inline-box;display:inline-block; margin-top:10px;">
			<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;padding-left:30px;text-align:right;color:#666666;font-size:14px;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap;" title="${x['field_title']}">${x['field_title']}：</span>
			</#if>
			<#if x['field_queryMode']=="group">
				<#if x['field_isQuery']=="Y">
                    <input type="text" name="${x['field_id']}_begin"  style="height:30px;line-height:30px;width: 150px"  <#if x['field_type']=="Date">class="Wdate"  <#if x['field_showType']=="datetime"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" </#if> <#if x['field_showType']=="date"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" </#if> </#if> value="${x['field_value_begin']}" />
				<span style="display:-moz-inline-box;display:inline-block;width: 8px;text-align:right;">~</span>
                    <input type="text" name="${x['field_id']}_end"  style="height:30px;line-height:30px;width: 150px" <#if x['field_type']=="Date">class="Wdate"    <#if x['field_showType']=="datetime"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" </#if> <#if x['field_showType']=="date"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" </#if> </#if> value="${x['field_value_end']}"/>
				<#else>
				<input type="hidden" name="${x['field_id']}_begin"   value="${x['field_value_begin']}"/>
				<input type="hidden" name="${x['field_id']}_end"    value="${x['field_value_end']}"/>
				</#if>
			</#if>
			<#if x['field_queryMode']=="single">
				<#if x['field_isQuery']=="Y">
					<#if  (x['field_dictlist']?size >0)>
						<select name = "${x['field_id']}">
							<option value = "">---请选择---</option>
							<#list x['field_dictlist']  as xd>
								<option value = "${xd['typecode']}">${xd['typename']}</option>
							</#list>
						</select>
					</#if>
					<#if  (x['field_dictlist']?size <= 0)>
						<#if x['field_showType']!='popup'>
						<input type="text" name="${x['field_id']}"  id="${x['field_id']}" class="search-input" <#if x['field_type']=="Date">class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"</#if>  value="${x['field_value']?if_exists?default('')}" />
						<#else>
						<input type="text" name="${x['field_id']}"  id="${x['field_id']}" style="width: 100px" 
										class="searchbox-inputtext" value="${x['field_value']?if_exists?default('')}"
								       />
						<span class="suoshu" style="position:static;margin-left:-27px;maring-bottom:-7px;padding-bottom:8px;" onClick="inputClick(this,'${x['field_dictField']?if_exists?html}','${x['field_dictTable']?if_exists?html}','${x['popup_attr']?if_exists?html}','${x['gis_attr']?if_exists?html}');"></span>
						</#if>
					</#if>
				<#else>
						<input type="hidden" name="${x['field_id']}"    value="${x['field_value']?if_exists?default('')}" />
				</#if>
				
			<#if x['field_isQuery']=="Y">
				<#if (x['field_showType'])=="idcardread">
				<input class="read-card-mini btn btn-default"  type="button"  onClick="idcardRead('${x['field_id']}')"></input>
				
				
				</#if>
			</#if>
				
			</#if>
			
			</span>	
		</#if>
	</#list>
	
	<!--<br/>-->
	<div style="height:10px;">&nbsp;</div>
	
		<#list config_queryList  as x>
			<#if (x['field_mainQuery']!)=="N" >
				<#if x['field_isQuery']=="Y" >
				<span  style="display:none; margin-top:10px;" class="search-hide">
				<span style="vertical-align:middle;display:-moz-inline-box;display:inline-block;padding-left:30px;text-align:right;color:#666666;font-size:14px;text-overflow:ellipsis;-o-text-overflow:ellipsis; overflow: hidden;white-space:nowrap;" title="${x['field_title']}">${x['field_title']}：</span>
				</#if>
				<#if x['field_queryMode']=="group">
					<#if x['field_isQuery']=="Y">
                        <input type="text" name="${x['field_id']}_begin"  style="height:30px;line-height:30px;width: 150px"  <#if x['field_type']=="Date">class="Wdate"  <#if x['field_showType']=="datetime"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" </#if> <#if x['field_showType']=="date"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" </#if> </#if> value="${x['field_value_begin']}" />
					<span style="display:-moz-inline-box;display:inline-block;width: 8px;text-align:right;">~</span>
                        <input type="text" name="${x['field_id']}_end"  style="height:30px;line-height:30px;width: 150px" <#if x['field_type']=="Date">class="Wdate"    <#if x['field_showType']=="datetime"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'});" </#if> <#if x['field_showType']=="date"> onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});" </#if> </#if> value="${x['field_value_end']}"/>
					<#else>
					<input type="hidden" name="${x['field_id']}_begin"   value="${x['field_value_begin']}"/>
					<input type="hidden" name="${x['field_id']}_end"    value="${x['field_value_end']}"/>
					</#if>
				</#if>
				<#if x['field_queryMode']=="single">
					<#if x['field_isQuery']=="Y">
						<#if  (x['field_dictlist']?size >0)>
							<select name = "${x['field_id']}">
								<option value = "">---请选择---</option>
								<#list x['field_dictlist']  as xd>
									<option value = "${xd['typecode']}">${xd['typename']}</option>
								</#list>
							</select>
						</#if>
						<#if  (x['field_dictlist']?size <= 0)>
							<#if x['field_showType']!='popup'>
							<input type="text" name="${x['field_id']}"  id="${x['field_id']}" class="search-input" <#if x['field_type']=="Date">class="Wdate" onclick="WdatePicker({dateFmt:'yyyy-MM-dd'});"</#if>  value="${x['field_value']?if_exists?default('')}" />
							<#else>
							<input type="text" name="${x['field_id']}"  id="${x['field_id']}" style="width: 100px" 
											class="searchbox-inputtext" value="${x['field_value']?if_exists?default('')}"
									       onClick="inputClick(this,'${x['field_dictField']?if_exists?html}','${x['field_dictTable']?if_exists?html}','${x['popup_attr']?if_exists?html}','${x['gis_attr']?if_exists?html}');" />
							</#if>
						</#if>
					<#else>
							<input type="hidden" name="${x['field_id']}"    value="${x['field_value']?if_exists?default('')}" />
					</#if>
						
					<#if x['field_isQuery']=="Y">
						<#if (x['field_showType'])=="idcardread">
						<input class="read-card-mini btn btn-default"  type="button"  onClick="idcardRead('${x['field_id']}')"></input>
						
						
						</#if>
					</#if>
						
					</#if>
				
					</span>


					<script type="text/javascript">
						$(function(){
							$(".adown-new").show();
						});
					</script>			
		</#if>
		
		
	</#list>
</#if>

	<#if  (config_queryList?size>0) >
		<!--查询按钮区域 start-->
		<div class="findBox-new">
			<a href="#" class="findbtn-new" iconCls="icon-search" onclick="${config_id}Listsearch()" title="查询">&nbsp;</a>
			<a href="#" class="resetbtn-new" iconCls="icon-reload" onclick="${config_id}searchReset('${config_id}List')" title="重置">&nbsp;</a>
			<a href="#" class="aup-new" onclick=" " title="收起查询条件" style="display:none;">&nbsp;</a>
			<a href="#" class="adown-new" onclick=" " title="展开查询条件" style="display:none;" >&nbsp;</a>
		</div>
		<!--查询按钮区域 end-->
	</#if>

	</div>
	<div style="height:30px;" class="datagrid-toolbar">
	<span style="float:left;" >
	
	<a  id="add" href="#"  class="addbtn-new" plain="true"  icon="icon-add" onclick="${config_id}add()" title="新增"></a>
	<a id="delete" href="#" class="delbtn-new" plain="true"  icon="icon-remove" onclick="${config_id}delBatch()" title="删除"></a>
	<!--<a id="import" href="#"  class="easyui-linkbutton" plain="true"  icon="icon-put" onclick="add('${config_name}Excel数据导入','excelTempletController.do?goImplXls&tableName=${config_id}','${config_id}List')">Excel数据导入</a>-->
	<a id="excel" href="#" class="exportbtn-new" plain="true" onclick="${config_id}ExportExcel()"  icon="icon-putout" title="Excel导出"></a>
	
	<#list config_buttons as x>
		<#if x['buttonStyle'] == 'button' && x['buttonStatus']=='1'>
			<a title="${x['buttonName']}" id="${x['buttonCode']}" href="#" class="${x['buttonIcon']?if_exists?default('pictures')}" plain="true"  icon="${x['buttonIcon']?if_exists?default('pictures')}" 
				<#if x['optType'] == 'action'>
				onclick="doBusButton('cgFormBuildController.do?doButton&formId=${x['formId']}&buttonCode=${x['buttonCode']}&tableName=${config_id}','${x['buttonName']}','${config_id}List')" ></a>
				<#else>
				onclick="${x['buttonCode']}();"></a>
				</#if>
		</#if>
	</#list>
	</span>
	
<#if  (config_queryList?size >0)>
	<#if config_querymode == "group" >
		
	</#if>
	<#if config_querymode == "single">
		<span style="float:right">
		<input id="${config_id}Listsearchbox" class="easyui-searchbox"  data-options="searcher:${config_id}Listsearchbox,prompt:'请输入关键字',menu:'#${config_id}Listmm'"></input>
		<div id="${config_id}Listmm" style="width:120px">
		<#list config_queryList  as x>
			<#if x['field_isQuery']=="Y">
			<div data-options="name:'${x['field_id']}',iconCls:'icon-ok'  ">${x['field_title']}</div>
			<#else>
			</#if>
		</#list>
		</div>
		</span>
	</#if>
</#if>
	</div>
</div>




<div id="editFormDiv" style="display: none"  >
	<iframe id="editForm"   width="100%" height="100%" frameborder="no" border="0"  src="" ></iframe>
</div>
 <!--[if IE 8]>
      <style type="text/css"> 
.datagrid-toolbar div{padding-right:100px;}
 .findBox-new{margin-right:-100px;}
 .search-hide{ width:320px;}
}
 </style>
 <![endif]-->
<script type="text/javascript">
	$(function(){
		$(".aup-new").click(function(){
			$(this).hide();
			$(".adown-new").show();
			$(".search-hide").hide();
			var h = $(".datagrid-body").height()+30;
			$(".datagrid-body").height(h);
			$(".datagrid-pager").css('margin-top','-45px');
		});
		$(".adown-new").click(function(){
			$(this).hide();
			$(".aup-new").show();
			$(".search-hide").show();
			var h = $(".datagrid-body").height()-30;
			$(".datagrid-body").height(h);
			$(".datagrid-pager").css('margin-top','-76px');
	
		});
	});
</script>